#pragma once
#include "mytypes.h"

namespace poly
{

class Camera
{
public:
	Camera();

	enum HANDEDNESS
	{
		RIGHTHANDED,
		LEFTHANDED
	};

	enum PROJECTION
	{
		ORTHO,
		ORTHO_OFFCENTER,
		PERSPECTIVE,
		PERSPECTIVE_OFFCENTER,
		PERSPECTIVE_FOV
	};

	HANDEDNESS hand;
	PROJECTION projectionType;

	float3 eye;
	float3 at;
	float3 up;

	float zn;
	float zf;

	union
	{
		struct
		{
			float w;
			float h;
		} ortho;

		struct
		{
			float l;
			float r;
			float b;
			float t;
		} orthoOffCenter;

		struct
		{
			float w;
			float h;
		} perspective;

		struct
		{
			float l;
			float r;
			float b;
			float t;
		} perspectiveOffCenter;

		struct
		{
			float fovy;
			float aspect;
		} perspectiveFov;
	};

	float44 view();
	float44 projection();
};

} // end of poly
